home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5462 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. Newsgroups: comp.lang.c
  3. Subject: Re: int main() vs int main(void)
  4. Message-ID: <danpop.823791491@rscernix>
  5. From: danpop@mail.cern.ch (Dan Pop)
  6. Date: 8 Feb 96 14:58:11 GMT
  7. References: <1996Feb7.201848.18734@atlas.tntech.edu>
  8. Organization: Air Force Flight Test Center
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <1996Feb7.201848.18734@atlas.tntech.edu> jad7084@tntech.edu (Jim Davis) writes:
  13.  
  14. >Okay, void main() is naughty, but there's something else I've been
  15. >wondering about, and I can't find it in the FAQ.
  16. >
  17. >Is there a difference between
  18. >
  19. >  int main()
  20. >  int main(void)
  21. >
  22. >?  () is equivalent to (void), right?  Does it matter?  Am I worried about
  23. >nothing?
  24.  
  25. As part of a function definition, the two forms are 100% equivalent.
  26.  
  27. As function declarations, the second is a prototype while the first
  28. allows main to be called with any (number and type of) arguments.
  29.  
  30. Dan
  31. --
  32. Dan Pop
  33. CERN, CN Division
  34. Email: danpop@mail.cern.ch 
  35. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  36.